package com.sergio.compress.model.base;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Objects;

/**
 * @Author : Sergio.D
 * @Description :
 * @CreateDate ：2023/6/17 11:57
 */
public class MockDataWrapper {
    @Accessors(chain = true)
    @Getter
    @Setter
    private List<MockDataBase> testDataBaseList;

    public MockDataWrapper(List<MockDataBase> testDataBaseList) {
        this.testDataBaseList = testDataBaseList;
    }

    public MockDataWrapper() {
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MockDataWrapper that = (MockDataWrapper) o;

        StringBuilder mismatchedItems = new StringBuilder();

        if (!Objects.equals(testDataBaseList, that.testDataBaseList)) {
            mismatchedItems.append("testDataBaseList: ").append(testDataBaseList).append(" != ").append(that.testDataBaseList).append("\n");
        }

        if (mismatchedItems.length() > 0) {
            System.out.println("Not all properties are equal:");
            System.out.println(mismatchedItems.toString());
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hash(testDataBaseList);
    }
}
